import {Page} from '@/base/Page';
import {Activity} from '@/base/model/Activity';
// import {deleteWishesOperate, getWishesList, PutWishes} from '@/base/api/BannersApi';

import {getActivityList} from '@/base/api/ActivityApi';

class Form {
  ActivityName = '';
}

export class ActivityBloc {
  form = new Form();
  paged: Page<Activity> = new Page<Activity>([], 0, 1, 15, 0, []);
  loading = false;
  type: string | undefined;
  logintype: string | undefined;

  load(pageIndex: number, pageSize: number) {

    // this.loading = true;
    // return getActivityList({
    //   pageIndex,
    //   pageSize,
    //   sortDirection: 'DESC',
    //   ActivityName: this.form.ActivityName
    // }).then((res) => {
    //   this.paged = res.data;
    // }).finally(() => {
    //   this.loading = false;
    // });
  }
  reset() {
    this.form = new Form();
    this.paged.pageIndex = 1;
    this.paged.pageSize = 15;
    this.load(this.paged.pageIndex, this.paged.pageSize);
  }
  // removeItem(dateItem: Activity) {
  //   this.loading = true;
  //   return deleteWishesOperate({id: dateItem.id})
  //     .finally(() => {
  //       this.loading = false;
  //     });
  // }

  // modifyItem(
  //   wishId: number,
  //   isAble: number
  // ) {
  //   this.loading = true;
  //   return PutWishes({
  //     wishId,
  //     isAble
  //   }).then((res) => {
  //     this.load(this.paged.pageIndex, this.paged.pageSize);
  //   }).finally(() => {
  //     this.loading = false;
  //   })
  // }
}
